import request from "@/utils/request"


/**
 * 获取所有维修单
 */
export function getRepair() {
  return request({
    url: '/repair?action=',
    method: 'get'
  })
}

/**
 * 根据维修单id查看维修单详情
 */
export function getRepairDetails(id) {
  return request({
    url: '/repair/' + id,
    method: 'get'
  })
}

/**
 * 根据维修单id查看维修单详情
 *
 */
export function deleteRepair(id) {
  return request({
    url: '/repair/' + id,
    method: 'delete'
  })
}

/**
 * 转交工单
 * @param repair_id 工单id
 * @param engineer_id 工程师id
 * @returns {AxiosPromise}
 */
export function transferTask(repair_id,engineer_id) {
  return request({
    url: `/repair/${repair_id}?action=UpdateRepairEngineer&engineer_id=${engineer_id}`,
    method: 'put'
  })
}


